﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XY_PLC
{
    public interface IImprovePLC : IXYPLC
    {
        /// <summary>
        /// 读取PLC心跳
        /// </summary>
        /// <returns></returns>
        public void ReadPLCHeartBeat(out bool HeartBeat);

        /// <summary>
        /// 读取BIB出风口温度报警
        /// </summary>
        /// <param name="index">索引 0 代表 0-1 层 1 代表 2-3 层 一次类推</param>
        /// <param name="Warning">true代表着 高温报警 false代表着 正常</param>
        /// <returns></returns>
        public bool ReadBIBFanOutputTemperatureWarning(int index, out bool Warning);

        /// <summary>
        /// 读取BIB出风口温度报警
        /// </summary>
        /// <param name="index">索引 0 代表 0-1 层 1 代表 2-3 层 一次类推</param>
        /// <param name="Warning">true代表着 高温报警 false代表着 正常</param>
        /// <returns></returns>
        public bool ReadControlFanOutputTemperatureWarning(int index, out bool Warning);

        /// <summary>
        /// 读取BIB出风口温度
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Temperature"></param>
        /// <returns></returns>
        public bool ReadBIBFanOutputTemp(int index, out double Temperature);

        /// <summary>
        /// 读取Control出风口温度
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Temperature"></param>
        /// <returns></returns>
        public bool ReadControlFanOutputTemp(int index, out double Temperature);

        /// <summary>
        /// 读取BIB风扇出风口速度
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Speed"></param>
        /// <returns></returns>
        public bool ReadBIBFanOutoutSpeed(int index, out double Speed);

        /// <summary>
        /// 读取控制风扇进风口速度
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Speed"></param>
        /// <returns></returns>
        public bool ReadBIBFanInputSpeed(int index, out double Speed);

        /// <summary>
        /// 读取主控区风扇速度
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Speed"></param>
        /// <returns></returns>
        public bool ReadControlFanSpeed(int index, out double Speed);

        /// <summary>
        /// 读取入水口水温
        /// </summary>
        /// <param name="Temperature"></param>
        /// <returns></returns>
        public bool ReadWaterInletTemp(out double Temperature);

        /// <summary>
        /// 读取出水口水温
        /// </summary>
        /// <param name="Temperature"></param>
        /// <returns></returns>
        public bool ReadWaterOutletTemp(out double Temperature);

        /// <summary>
        /// 读取水泵进水压力
        /// </summary>
        /// <param name="Pressure"></param>
        /// <returns></returns>
        public bool ReadWaterInletPressure(out double Pressure);

        /// <summary>
        /// 读取水泵出水压力
        /// </summary>
        /// <param name="Pressure"></param>
        /// <returns></returns>
        public bool ReadWaterOutletPressure(out double Pressure);

        /// <summary>
        /// 读取冷水口流量
        /// </summary>
        public bool ReadColdOutletWaterFlow(out double Flow);

        /// <summary>
        /// 写入PLC心跳
        /// </summary>
        /// <param name="HeartBeat"></param>
        /// <returns></returns>
        public void WriteHeartBeat();

        /// <summary>
        /// 写入BIB风扇出风口挡位
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Gear"></param>
        /// <returns></returns>
        public bool WriteBIBFanOutputGear(int index, int Gear);

        /// <summary>
        /// 写入控制风扇进风口挡位
        /// </summary>
        /// <param name="index"></param>
        /// <param name="Gear"></param>
        /// <returns></returns>
        public bool WriteBIBFanInputGear(int index, int Gear);

        /// <summary>
        /// 开启BIB与Control区对应层数的风扇开关
        /// </summary>
        /// <param name="index">0 代表 0-1 层 1 代表 2-3 层 依次类推</param>
        /// <param name="Enable"></param>
        /// <returns></returns>
        public bool WriteFanEnbale(int index, bool Enable);

        /// <summary>
        /// 水泵实际频率监控
        /// </summary>
        /// <param name="Frequency">1000 => 10HZ</param>
        /// <returns></returns>
        public bool MonitorPumpFrequency(out double Frequency);

        /// <summary>
        /// 设置水泵频率
        /// </summary>
        /// <param name="Frequency">1000 => 10HZ</param>
        /// <returns></returns>
        public bool SetPumpFrequency(int Frequency);

        /// <summary>
        /// 水泵停止
        /// </summary>
        /// <param name="Enable"></param>
        /// <returns></returns>
        public bool StartPumpForward(bool Enable);

        /// <summary>
        /// 水泵故障确认
        /// </summary>
        /// <param name="True"></param>
        /// <returns></returns>
        public bool ConfirmPumpFault(bool True);

        /// <summary>
        /// 设置风扇转速
        /// </summary>
        /// <param name="Layer">层数 0 => 0,1BIB </param>
        /// <param name="Power">功耗</param>
        /// <returns></returns>
        public bool SetBIBFanSpeed(int Layer, int Power);

        /// <summary>
        /// 读心跳包
        /// </summary>
        public void ReadHeartBeat();
    }
}
